package com.commerce.service.impl;

import com.commerce.mapping.FileMD5Mapping;
import com.commerce.model.FileMD5;
import com.commerce.service.FileMD5Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FileMD5ServiceImpl implements FileMD5Service {

    @Autowired
    private FileMD5Mapping fileMD5Mapping;

    /**
     * 查询该md5有没有数据
     *
     * @param md5
     * @return
     */
    @Override
    public FileMD5 selectByMD5(String md5) {
        return fileMD5Mapping.selectByMD5(md5);
    }

    /**
     * 新增
     *
     * @param fileMD5
     * @return
     */
    @Override
    public boolean insert(FileMD5 fileMD5) {
        return fileMD5Mapping.insert(fileMD5)>0?true:false;
    }
}
